class AddTroopsToDefenders < ActiveRecord::Migration
  def self.up
    rename_column :troops, :army_id, :troopable_id
    add_column :troops, :troopable_type, :string

    execute 'UPDATE troops SET troopable_type = "Army"'
  end

  def self.down
    rename_column :troops, :troopable_id, :army_id
    remove_column :troops, :troopable_type
  end
end
